package com.maple.soa.config;

import com.maple.soa.pojo.DataSources;
import org.springframework.context.annotation.*;

/**
 * @author lijian
 * @date 2020/7/5
 */
@Configuration
@ComponentScan("com.maple.soa")
@Import(SystemConfig.class)
public class AppConfig {

    @Bean
    @Primary
    public DataSources mysqlDatasources() {
        DataSources dataSources = new DataSources();
        dataSources.setDriver("MySql");
        dataSources.setUrl("mysql://mysql");
        dataSources.setUsername("mysql");
        dataSources.setPassword("123456");
        return dataSources;
    }

    @Bean
    public DataSources oracleDatasources() {
        DataSources dataSources = new DataSources();
        dataSources.setDriver("Oracle");
        dataSources.setUrl("oracle://oracle");
        dataSources.setUsername("oracle");
        dataSources.setPassword("123456");
        return dataSources;
    }

}
